import { request } from 'ice';

/** 收货详情 */
export const getReceiveShippingDetail = (shippingId: number): Promise<any> => {
  return request.get('/operating/receive/already/detail', { params: { shippingId } });
};

/** 根据货运单号获取收货详情 */
export const getReceiveShippingDetailByNo = (shippingLabel: string): Promise<any> => {
  return request.get('/operating/receive/shipping/detail/by/label', { params: { shippingLabel } });
};

/** 确认收货 */
export const saveReceiving = (data: LogisticsState.ReceiveParams): Promise<any> => {
  return request.post('/operating/receive/product/receive', data);
};

/** 鉴定详情 */
export const getAppraisalDetail = (shippingLabel: string): Promise<any> => {
  return request.get('/operating/appraisal/stay/detail', { params: { shippingLabel } });
};

/** 根据货运单号获取鉴定详情 */
export const getAppraisalDetailByNo = (shippingLabel: string): Promise<any> => {
  return request.get('/operating/receive/shipping/detail/by/label', { params: { shippingLabel } });
};

/** 确认鉴定 */
export const saveAppraisal = (data: LogisticsState.AppraisalParams): Promise<any> => {
  return request.post('/operating/appraisal/save', data);
};

/** 发货详情 */
export const getDeliveryDetail = (shippingId: number): Promise<any> => {
  return request.get('/operating/send/detail', { params: { shippingId } });
};

